<div class="es-section article-list-header le" style="margin-top: 0px;">
  {% include 'TopxiaWebBundle:Article/Part:list-header-nav.html.twig' %}

  {% if not featuredArticles and not promotedArticles %}
    {% if is_granted('ROLE_ADMIN') %}
      <div class="alert alert-warning">头条大图轮播功能需先在后台资讯管理页面给正文上传图片以及添加头条属性<a href="{{ path('admin_article') }}">前往设置</a></div>
    {% endif %}
  {% else %}

    <div class="row">
      <!-- 轮播图 -->
      <div class="aricle-carousel col-md-8">
        <div class="swiper-container">
          <div class="swiper-wrapper">
            {% for index,featuredArticle in featuredArticles %}
              <div class="swiper-slide">
                <a href="{{ path('article_detail', {id:featuredArticle.id}) }}">
                  <img class="img-responsive" src="{{ asset(featuredArticle.picture) }}"  alt="{{ featuredArticle.title }}">
                  <div class="swiper-caption">
                   {{ featuredArticle.title }}
                  </div>
                  <div class="image-overlay"></div>
                </a>
              </div>
            {% endfor %}
          </div>
          <div class="swiper-pager"></div>
        </div>
      </div>
      <div class="article-header-right col-md-4 hidden-sm hidden-xs">
        {% for index,promotedArticle in promotedArticles %}
        <a href="{{ path('article_detail', {id:promotedArticle.id}) }}" class="topic-post-small {% if loop.index == 1 %}one{% else %}two{% endif %}">
          <div class="content">
            <p>{{ promotedCategories[promotedArticle['id']].name }}</p>
            <h4 class="title">{{ promotedArticle.title|plain_text(125) }}</h4>
          </div>
        </a>
        {% endfor %}
      </div>
    </div>

  {% endif %}
</div>
